<?php

class Soul_Validation_Rule_RangeDate extends Soul_Validation_Rule_Base {
    
	private $_max = NULL;
	private $_min = NULL;
	
    public function  __construct(){
        parent::__construct();
    }
    
    public function getMax($value){
    	return $this->_max;
    }    
    public function setMax($value){
    	$this->_max = $value;
    }
    
    public function getMin(){
    	return $this->_min;
    }
    public function setMin($value){
    	$this->_min = $value;
    }

    public function getType(){
        return 'rangeDate';
    }

    public function check($value) {
        $time = strtotime($value);
        $mintime = strtotime($this->getMin());
        $maxtime = strtotime($this->getMin());
        return $time <= $maxtime && $time >= $mintime;
    }
}